package pl.edu.mimuw.irs.core.model.petrinet;

import java.util.HashSet;
import java.util.Set;

import pl.edu.mimuw.irs.core.util.Position;

/**
 * @author Jakub Rauch
 * Created on: 2009-05-07
 */
public abstract class Node extends Element implements INode {

	private static final long serialVersionUID = -6271392860745827709L;
	
	// *** Attributes
	
	// Position of this node
	private Position position;
	// Arcs connected to this Place
	private Set<Arc> incomingArcs; // TODO : Change to Map - for efficiency
	private Set<Arc> outgoingArcs;
	// Getters and setters
	@Override
	public Position getPosition() {
		if (position == null) position = new Position();
		return this.position;
	}
	public void setPosition(Position position) {
		this.position = position;
	}
	public Set<Arc> getIncomingArcs() {
		if (incomingArcs == null) incomingArcs = new HashSet<Arc>();
		return incomingArcs;
	}
	public void setIncomingArcs(Set<Arc> incomingArcs) {
		this.incomingArcs = incomingArcs;
	}
	public Set<Arc> getOutgoingArcs() {
		if (outgoingArcs == null) outgoingArcs = new HashSet<Arc>();
		return outgoingArcs;
	}
	public void setOutgoingArcs(Set<Arc> outgoingArcs) {
		this.outgoingArcs = outgoingArcs;
	}

	// *** Methods
	
}
